#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>
int compar(const void* p1, const void* p2)
{
    return *(int*)p1 - *(int*)p2;
}

bool containsDuplicate(int* nums, int numsSize) {
    qsort(nums, numsSize, sizeof(int), compar);
    for (int i = 0; i < numsSize - 1; i++)
    {
        if (nums[i] == nums[i + 1])
        {
            return true;
        }

    }
    return false;
}



int main()
{
    int arr[5] = { 1,2,2,2,1 };
    bool a = containsDuplicate(arr, 5);
    printf("%d", a);
    return 0;
}